<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>jsonp</title>
	<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript">	
		// 跨域
		$(function () {

			$('#text1').keyup(function() {

				var val = $(this).val();

				$.ajax({
					url: 'https://sug.so.360.cn/suggest?',
					type: 'get',
					dataType: 'jsonp',
					data:{word:val}
					})
					.done(function(data) {
						$('.list').empty();
						for(var i=0;i<data.s.length;i++){
							var $li = $('<li>'+data.s[i]+'</li>');
							$li.prependTo('.list');
						}
					})
					.fail(function() {
						console.log("error");
					})
				})
			})
	</script>
</head>
<body>
	<input type="text" name="" id="text1">
	<ul class="list"></ul>
</body>
</html>